<?php
/**
 * Created by PhpStorm.
 * User: ls721
 * Date: 2016/10/27 0027
 * Time: 20:33
 */class Domain_Notice{

    public function getNotice($notice_id){
        $rs=array();
        $model=new Model_Notice;
    if(empty($notice_id)){
        return $model->getAllNotice();
    }else{
        return $model->getNotice($notice_id);
    }
    }

    public function setNotice($notice_id,$notice,$url)
    {
        $model=new Model_Notice();
        if(empty($notice_id)){
            $Nid=uniqid('N');
            $model->insert(array('id'=>$Nid,'Notice'=>$notice,'URL'=>$url));
            return $model->getNotice($Nid);
        }else{
            $model->update($notice_id,array('Notice'=>$notice,'URL'=>$url));
            return $model->getNotice($notice_id);
        }

    }

}
